This archive contains the code and data files necessary to replicate the results reported in Lupu et al (forthcoming), ”A New Measure of Congruence: The Earth Mover’s Distance.”

Please note that the emdist package defaults to maximum dimensionality of 4. This can be increased, but it must be compiled in. To replicate the results below, please download the .tar file from rforge.net/emd/ and install from source by running the following command in a command prompt environment (e.g., on a Mac, in Terminal):

PKG_CPPFLAGS=-DFDIM=[N] R CMD INSTALL [emdist]

where [emdist] points to the .tar file and [N] is the maximum dimensionality you'd like. (Elide both sets of brackets in the code.) Verify that it has worked correctly by calculating the EMD for dimensions greater than 4, for which you should not receive a warning message. (My install set N=100.)

The files contained in this archive are as follows:

########
# DATA #
########

Lupu-Selios-Warner-GSreplication.csv contains the variables used in the replication and extension of Golder and Stramski (2010). 

Lupu-Selios-Warner-LAPOP-PELA.csv contains the variables used in the “Mass-elite congruence in Latin America” application. Please see the paper and appendix for data citations.

###########
# R FILES #
###########

Lupu-Selios-Warner-EMD-code.R contains all of the code for all of the analysis in the paper and appendix.

#############
# CODEBOOKS #
#############

Lupu-Selios-Warner-GSreplication-codebook.txt contains a description of the variables included in the data for the replication and extension of Golder and Stramski (2010).

Lupu-Selios-warner-LAPOP-PELA-codebook.txt contains a description of the variables included in the data for the "Mass-elite congruence in Latin America" application. Please see the paper and appendix for data citations.